<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <!-- Required meta tags -->
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
          integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

    <title>Hello, world!</title>
    <style>
        .body {
            display: inline-block;
            padding-top: 10px;
        }

        .body .body_left {
            float: left;
            width: 200px;
            padding-right: 40px;
            padding-left: 10px;
            /*padding-right: 82%;*/
        }

        .body .body_right {
            float: left;
            width: 1000px;
            padding-right: 0px;
        }
        .body .col-sm-3 .card {
            padding-right: 10px;
            padding-bottom: 10px;
        }
    </style>
    <script src="js/pages.js"></script>
</head>
<body onload="goPage(1,4)">
<%@include file="../common/navbar.jsp" %>
<div class="body">
    <div class="body_left">
        <ul class="list-group">
            <li class="list-group-item">书籍分类</li>
            <li class="list-group-item"><a href="/ClassifyBooks?classifyId=1">小说</a></li>
            <li class="list-group-item"><a href="/ClassifyBooks?classifyId=2">文学</a></li>
            <li class="list-group-item"><a href="/ClassifyBooks?classifyId=3">艺术</a></li>
            <li class="list-group-item"><a href="/ClassifyBooks?classifyId=4">成功励志</a></li>
            <li class="list-group-item"><a href="/ClassifyBooks?classifyId=5">管理</a></li>
            <li class="list-group-item"><a href="/ClassifyBooks?classifyId=6">历史</a></li>
            <li class="list-group-item"><a href="/ClassifyBooks?classifyId=7">经济</a></li>
        </ul>
    </div>
    <div class="body_right">
        <div class="row">
            <c:forEach var="item" items="${books}">
                <div class="col-sm-3">
                    <div class="card mb-3" style="width: 14rem;">
                        <img src="images/${classifyName}/${item.bookName}.jpg" class="card-img-top" alt="...">
                        <div class="card-body">
                            <h5 class="card-title">${item.bookName}</h5>
                            <p class="card-text">${item.bookAuthor}</p>
                            <p class="card-text">￥${item.price}</p>
                            <a href="/showBookDetail?bookId=${item.bookId}" class="btn btn-primary">详情</a>
                        </div>
                    </div>
                </div>
            </c:forEach>
        </div>
    </div>
</div>
<table width="60%" align="right">
    <tr><td><div id="barcon" name="barcon"></div></td></tr>
</table>
</body>
</html>